home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
usenet
/
sources
/
volume90
/
kernel
/
xoper_22
/
part02
/
Xoper.a.ac
Wrap
Text File
|
1990-02-01
|
40KB
|
1,570 lines
beq got_enter
cmp.b #27,0(a2,d3) ;esc
bne 799$
tst.w getanswer
bne 100$
clr.b insmode
clr.w ibufferlen
move.w #200,curpos
bsr UpdateIArea
clr.w curpos
tst.w bottomin
bne.s 700$
move.w #1,bottomin
bsr getcurpos
cmp.b #5,timerstate
bne.s 765$
bsr starttimer
765$ bra 100$
700$ move.b timerio+8,timerstate
bsr stoptimer
move.w edline(PC),d0
move.l firstline(PC),d4
cmp.w d4,d0
bmi.s 701$
move.w d4,d5
add.w rows(PC),d5
cmp.w d5,d0
bmi.s 702$
701$ move.w rows(PC),d0
lsr.w #1,d0
add.w d4,d0
702$ move.l numlines(PC),d3
subq #1,d3
cmp.w d3,d0
ble.s 703$
move.w d3,d0
703$ move.w d0,edline
sub.w d4,d0
lsl.w #3,d0
add.w #18,d0
move.w d0,cposy
clr.w bottomin
tst.w loffset
beq.s 704$
clr.w loffset
bsr blastout
704$ bra 100$
799$ cmp.b #8,0(a2,d3) ;Backspace
bne.s 114$
tst.w d4
beq 102$
bsr delchar
subq #1,d4
move.w d4,curpos
bra 102$
114$ cmp.b #127,0(a2,d3) ;del
bne.s 150$
178$ cmp.w ibufferlen(PC),d4
bge 102$
addq #1,d4
bsr delchar
bra 102$
150$ cmp.b #9,0(a2,d3) ;tab
bne 197$
move.w cmdcompflag(PC),d0
bpl.s 151$
move.w curpos(PC),cmdcomplen
151$ move.w #1,cmdcompflag
155$ move.w cmdcompnr(PC),d0
bsr getcmdptr
move.l d0,a0
move.w cmdcomplen(PC),d4
lea inputbuffer,a1
subq #1,d4
152$ tst.b 0(a0)
beq.s 153$
cmp.b (a0)+,(a1)+
bne.s 153$
dbf d4,152$
move.l d0,a1
lea inputbuffer,a0
154$ move.b (a1)+,(a0)+
dbeq.s d4,154$
neg.w d4
subq #1,d4
move.w d4,curpos
move.w d4,ibufferlen
add.w #1,cmdcompnr
cmp.w #cmdnum,cmdcompnr
beq.s 156$
bra 100$
153$ move.w cmdcompnr(PC),d0
addq #1,d0
move.w d0,cmdcompnr
cmp.w #cmdnum,d0
bmi.s 155$
156$ clr.w cmdcompnr
bra 100$
197$ cmp.b #3,0(a2,d3) ;ctrl c
bne.s 104$
move.b #1,cbreak
104$ tst.b addlines
bne processnxtmsg
cmp.b #$18,0(a2,d3) ;ctrl x
bne.s 300$
clr.w ibufferlen
clr.w curpos
bra 100$
300$ cmp.b #$19,0(a2,d3) ;ctrl y
bne.s 106$
move.w curpos,ibufferlen
bra 100$
106$ move.w #$100,d5 ;NumPad
and.w qualifier(PC),d5
beq 105$
move.l firstline(PC),d5
cmp.b #'7',0(a2,d3) ;'Home'
bne.s 200$
moveq #0,d5
199$ move.l d5,firstline
bsr blastout
tst.w bottomin
bne.s 196$
move.w edline(PC),d0
move.l firstline(PC),d1
cmp.w d1,d0
bmi.s 190$
add.w rows(PC),d1
cmp.w d1,d0
bmi.s 192$
190$ clr.w curpos
clr.w ibufferlen
move.w rows(PC),d0
lsr.w #1,d0
ext.l d0
add.l firstline(PC),d0
cmp.l numlines(PC),d0
bmi.s 191$
move.l numlines(PC),d0
subq #1,d0
191$ move.w d0,edline
192$ bsr getcurpos
bsr UpdateIArea
196$ bra 100$
200$ cmp.b #'8',0(a2,d3) ;'up arrow'
bne.s 201$
tst d5
beq 100$
subq #1,d5
bra.s 199$
201$ cmp.b #'9',0(a2,d3) ;'PgUp'
bne.s 203$
sub.w rows(PC),d5
bpl.s 199$
moveq #0,d5
bra.s 199$
203$ cmp.b #'1',0(a2,d3) ;'End'
bne.s 205$
222$ move.l numlines(PC),d5
sub.w rows(PC),d5
bpl 199$
moveq #0,d5
204$ bra 199$
205$ cmp.b #'2',0(a2,d3) ;'down arrow'
bne.s 206$
move.l d5,d2
add.w rows(PC),d2
cmp.l numlines(PC),d2
bge 100$
addq #1,d5
bra 199$
206$ cmp.b #'3',0(a2,d3) ;'PgDn'
bne.s 500$
add.w rows(PC),d5
move.l d5,d2
add.w rows(PC),d2
cmp.l numlines(PC),d2
bge.s 222$
bra 199$
500$ cmp.b #'4',0(a2,d3) ;left arrow
bne.s 501$
tst.w bottomin
beq 102$
move.w loffset(PC),d2
sub.w colms(PC),d2
bpl.s 502$
moveq #0,d2
502$ move.w d2,loffset
bsr blastout
bra 100$
501$ cmp.b #'6',0(a2,d3) ;right arrow
bne.s 170$
tst.w bottomin
beq 102$
move.w loffset(PC),d2
add.w colms(PC),d2
bra.s 502$
170$ cmp.b #'0',0(a2,d3) ;Ins
bne.s 177$
eor.b #1,insmode
bra.s 102$
177$ cmp.b #'.',0(a2,d3) ;Del
beq 178$
105$ tst.w bottomin
bne.s 777$
tst.w curpos
bne.s 777$
movem.l d0-d1,-(a7)
move.w edline(PC),d0
bsr findline
movem.l (a7)+,d0-d1
tst.l 8(a5)
beq intuiend
777$ move.w curpos(PC),d5
ext.l d5
moveq #79,d2
cmp.w d2,d5
bge 102$
tst.b insmode
beq.s 172$
cmp.w ibufferlen(PC),d5
bmi.s 171$
bra.s 173$
172$ sub d5,d2
lea 80(a1),a4
lea 79(a1),a3
103$ move.b -(a3),-(a4)
dbf d2,103$
173$ addq.w #1,ibufferlen
171$ move.b 0(a2,d3),0(a1,d5)
addq.w #1,curpos
102$ subq #1,d0
addq #1,d3
bra 101$
100$ bsr UpdateIArea
bra intuiend
got_enter bsr puthist
got_fkey bsr stoptimer
clr.b insmode
lea dummy,a1
lea inputbuffer,a2
move.w ibufferlen(PC),d2
beq.s 2$
tst.w bottomin
bne.s 5$
movem.l a1-a2,-(a7)
move.w edline(PC),d0
bsr findline
move.l 8(a5),d0
bsr gthex
lea hexarea(PC),a0
lea 0(a2,d2),a1
move.b #' ',(a1)+
move.b #'$',(a1)+
moveq #8,d0
CALL CopyMem,_SysBase(PC)
move.w ibufferlen(PC),d2
add.w #10,d2
move.w d2,ibufferlen
movem.l (a7)+,a1-a2
5$ subq #1,d2
1$ move.b (a2)+,(a1)+
dbf d2,1$
2$ move.b #10,(a1)+
move.w ibufferlen(PC),d0
ext.l d0
addq #1,d0
move.l d0,-(a7)
clr.w ibufferlen
tst.w bottomin
bne.s 4$
move.w #100,curpos
bsr UpdateIArea
4$ clr.w curpos
move.w #1,bottomin
bsr getcurpos
bsr UpdateIArea
move.l (a7)+,d0
move.w d0,repeatlen
clr.w repeat
clr.b printed
tst.w getanswer
beq.s 6$
rts
6$ bsr cli
tst.b printed
bne.s 3$
bsr starttimer
3$ bra intuiend
notarawkey
intuiend bsr.s replyintui
bra nextimsg
processnxtmsg
tst.b addlines
beq.s 1$
rts
1$ bra processmsgs
replyintui move.l intuimsg(PC),d0
beq.s 1$
move.l d0,a1
CALL ReplyMsg,_SysBase
1$ clr.l intuimsg
rts
;put an input line into the history buffer
puthist move.w ibufferlen(PC),d5
move.l d5,d0
cmp.w minnumchars(PC),d0
bcs 1$
move.l gothline(PC),d1
beq.s 5$
move.l d1,a2
cmp.w 8(a2),d5
bne.s 5$
lea 10(a2),a2
lea inputbuffer,a1
subq #1,d0
6$ cmp.b (a2)+,(a1)+
bne.s 5$
dbf d0,6$
move.l gothline,curhist
bra.s 1$
5$ move.w d5,d0
ext.l d0
add #10,d0
move.l #$10000,d1 ;MEMF_CLEAR
CALL AllocMem,_SysBase(PC)
tst.l d0
beq.s 1$
move.l d0,a0
move.w d5,8(a0)
lea 10(a0),a2
subq #1,d5
lea inputbuffer,a1
2$ move.b (a1)+,(a2)+
dbf d5,2$
move.w hnum(PC),d5
cmp.w maxhlines(PC),d5
bmi.s 3$
bsr remhistline
bra.s 4$
3$ addq #1,d5
move.w d5,hnum
4$ move.l d0,a1
move.l d0,curhist
lea history(PC),a0
CALL AddTail,_SysBase(PC)
1$ clr.l gothline
rts
;copy a history line into the input buffer
copyhistory lea inputbuffer,a0
move.w 8(a1),d3
ext.l d3
move.w d3,curpos
move.w d3,ibufferlen
subq #1,d3
lea 10(a1),a1
1$ move.b (a1)+,(a0)+
dbf d3,1$
rts
;remove one line from the history buffer
;pointer to the line in A1, returns pointer to the next line in d1
remhistline move.l d0,-(a7)
lea history(PC),a0
move.l 0(a0),a5
tst.l 0(a5)
beq.s 1$
CALL RemHead,_SysBase(PC)
move.l a5,a1
move.w 8(a1),d0
add #10,d0
ext.l d0
CALL FreeMem,_SysBase(PC)
1$ move.l (a7)+,d0
rts
;kill all history lines
killhistory bsr remhistline
move.l history(PC),a0
tst.l 0(a0)
bne.s killhistory
2$ clr.w hnum
clr.l curhist
rts
;delete one char from the input line
delchar lea inputbuffer,a3
lea 0(a3,d4.w),a3
lea -1(a3),a4
move d4,d5
1$ cmp.w #78,d5
bge.s 2$
move.b (a3)+,(a4)+
addq #1,d5
bra.s 1$
2$ subq.w #1,ibufferlen
rts
testsig move.l tasksigs(PC),d0
btst d1,d0
rts
;get the position of the input area
iareapos move.l wnptr(PC),a0
move.w 10(a0),d0
subq #4,d0
move.w d0,ipos
rts
;Update the current position of the input line
getcurpos tst.w bottomin
beq.s 1$
move.w ipos,cposy
rts
1$ move.w edline(PC),d3
sub.l firstline(PC),d3
lsl #3,d3
add.w #18,d3
move.w d3,cposy
rts
;refresh the input area
UpdateIArea move.l rastport(PC),a1
move.l #1,d0
CALL SetDrMd,gfxbase(PC)
moveq #6,d0
move.w cposy(PC),d1
move.l rastport(PC),a1
CALL Move,gfxbase(PC)
lea inputbuffer,a0
move.w ibufferlen(PC),d0
ext.l d0
move.w colms(PC),d1
sub.w bottomin(PC),d1
cmp.w d1,d0
bmi.s 1$
move.w d1,d0
1$ move.w d0,d2
move.l rastport(PC),a1
CALL Text,gfxbase(PC)
tst.w bottomin
bne.s 3$
move.w edline(PC),d0
bsr findline
move.w 12(a5),d3
sub.w d2,d3
bmi.s 3$
move.w colms(PC),d1
sub.w d2,d1
bmi.s 2$
cmp.w d1,d3
ble.s 4$
move.w d1,d3
4$ move.w d3,d0
lea 14(a5,d2.w),a0
move.l rastport(PC),a1
CALL Text,gfxbase(PC)
add.w ibufferlen(PC),d3
move.w d3,d2
3$ move.w colms(PC),d0
sub.w bottomin(PC),d0
move.l blanks(PC),a0
ext.l d0
sub.w d2,d0
bmi.s 2$
lea 0(a0,d2.w),a0
move.l rastport(PC),a1
CALL Text,gfxbase(PC)
2$ bsr putcursor
rts
clrcursor moveq #1,d7
bra.s ptc1
putcursor moveq #6,d7
ptc1 move.w curpos(PC),d0
move.w colms(PC),d1
subq #1,d1
sub.w bottomin(PC),d1
cmp.w d0,d1
bmi.s 1$
move.l rastport(PC),a1
move.l d7,d0
CALL SetDrMd,gfxbase(PC)
move.w cposy(PC),d1
move.w curpos(PC),d0
lsl.w #3,d0
addq #6,d0
move.l rastport(PC),a1
CALL Move,gfxbase(PC)
lea oneblank(PC),a0
moveq #1,d0
move.l rastport(PC),a1
CALL Text,gfxbase(PC)
1$ rts
;rebuild the window from scratch
setupscreen move.l rastport(PC),a1
moveq #0,d0
CALL SetRast,gfxbase(PC)
move.l wnptr,a0
CALL RefreshWindowFrame,intuibase(PC)
bsr getwindowsize
tst.w bottomin
bne.s 1$
move.w edline(PC),d0
move.l firstline(PC),d1
move.w rows(PC),d2
move.w d2,d4
move.w numlines(PC),d3
add.w d1,d2
cmp.w d2,d0
bmi.s 2$
lsr.w #1,d4
sub.w d4,d0
ext.l d0
move.l d0,firstline
2$ bsr tstfirstlin
1$ bsr getcurpos
bsr putiline
bsr blastout
bsr UpdateIArea
move.w rows,currenty
rts
putiline move.l rastport(PC),a1
moveq #1,d0
CALL SetAPen,gfxbase(PC)
move.l rastport(PC),a1
moveq #1,d0
CALL SetDrMd,gfxbase(PC)
move.l wnptr(PC),a5
move.w 10(a5),d1
sub.w #12,d1
moveq #0,d0
move.l rastport(PC),a1
CALL Move,gfxbase(PC)
move.w 8(a5),d0
move.w d1,-(a7)
move.l rastport(PC),a1
CALL Draw,gfxbase(PC)
move.w (a7)+,d1
tst.b ownscreen
bne.s 1$
move.w 8(a5),d0
addq #1,d1
move.l rastport(PC),a1
CALL Move,gfxbase(PC)
sub.w #16,d0
move.w d1,-(a7)
move.l rastport(PC),a1
CALL Draw,gfxbase(PC)
move.w (a7)+,d1
move.w 8(a5),d0
addq #1,d1
move.l rastport(PC),a1
CALL Move,gfxbase(PC)
sub.w #16,d0
move.l rastport(PC),a1
CALL Draw,gfxbase(PC)
1$ rts
getwindowsize
bsr freeblank
move.l wnptr(PC),a0
move.w 10(a0),d0
sub.w #26,d0
lsr.w #3,d0
move.w d0,rows
move.w 8(a0),d0
sub.w #12,d0
lsr.w #3,d0
move.w d0,colms
ext.l d0
moveq #0,d1
move.l d0,d6
CALL AllocMem,_SysBase(PC)
move.l d0,blanks
move.l d0,a0
subq #1,d6
1$ move.b #' ',(a0)+
dbf d6,1$
bsr iareapos
rts
readline move.b #'n',inputbuffer
tst.b fromfile
bne.s 1$
move.l #31000,firstline
bsr blastout
move.w #1,getanswer
bsr replyintui
5$ bsr processmsgs
move.w d0,d5
bsr replyintui
subq #1,d5
beq.s 5$
ori.b #$20,inputbuffer
clr.w getanswer
bsr RestoreOutput
1$ rts
ResumeOutput
move.l outchain(PC),d0
move.l d0,a1
beq.s 2$
move.l numlines,oldnumlines
move.l firstline,oldfirstline
4$ tst.l 0(a1)
beq.s 3$
move.l 0(a1),a1
bra.s 4$
3$ move.l a1,lastprinted
2$ move.l a1,oldpageend
rts
RestoreOutput
move.l oldpageend(PC),d3
beq.s 1$
move.l oldnumlines(PC),numlines
move.l oldfirstline(PC),firstline
move.l oldlastprinted(PC),lastprinted
move.l d3,a1
move.l 0(a1),a1
bsr killlines
move.l d3,a1
clr.l 0(a1)
bsr blastout
1$ rts
addline movem.l d0-d6/a0-a3,-(a7)
move.l rastport(PC),a1
moveq #1,d0
CALL SetAPen,gfxbase(PC)
move.l rastport(PC),a1
moveq #1,d0
CALL SetDrMd,gfxbase(PC)
move.w currenty(PC),d6
cmp.w rows(PC),d6
bmi.s 1$
bsr cls
1$ move.l lastprinted(PC),a0
move.w colms(PC),d5
move.w 12(a0),d3
lea 14(a0),a0
move.w currenty(PC),d6
move d6,d7
lsl #3,d6
add.w #18,d6
moveq #0,d4
bsr blastline
addq.w #1,currenty
move.l #31000,firstline
movem.l (a7)+,d0-d6/a0-a3
rts
cls movem.l d0-d6/a0-a3,-(a7)
move.l rastport(PC),a1
moveq #1,d0
CALL SetAPen,gfxbase(PC)
move.l rastport(PC),a1
moveq #1,d0
move.l rastport(PC),a1
CALL SetDrMd,gfxbase(PC)
move.w colms(PC),d5
clr.w d2
1$ move.w d2,d6
move d5,d7
lsl #3,d6
add.w #18,d6
moveq #0,d3
move.l blanks(PC),a0
bsr blastline
addq #1,d2
cmp.w rows(PC),d2
bmi.s 1$
clr.w currenty
movem.l (a7)+,d0-d6/a0-a3
rts
createscreen moveq #1,d1
moveq #80,d0
lea buffer,a0
sub.l a1,a1
CALL GetScreenData,intuibase(PC)
move.w buffer+76,nsviewmode
move.l buffer+12,nssize
lea newscreen(PC),a0
CALL OpenScreen,intuibase(PC)
move.l d0,screenptr
move.l d0,nwscreen
move.w #$f,nwtype
beq.s setupwindow
tst.l wnptr
beq.s 1$
move.l wnptr(PC),a0
move.l 4(a0),window_l
move.l 8(a0),window_w
CALL CloseWindow,intuibase(PC)
clr.l intuimsg
clr.l wnptr
1$ clr.l newwindow
move.l buffer+12,newwindow+4
move.l wnscrflags(PC),nwflgs
move.l wnscrflags+4(PC),nwflgs+4
move.b #1,ownscreen
setupwindow tst.b ownscreen
bne.s 3$
move.l window_l(PC),newwindow
move.l window_w(PC),newwindow+4
move.w #1,nwtype
move.l wnnormflgs(PC),nwflgs
move.l wnnormflgs+4(PC),nwflgs+4
3$ lea newwindow(PC),a0
CALL OpenWindow,intuibase(PC)
move.l d0,wnptr
beq exit
move.l d0,a0
move.l 50(a0),rastport ;wn->RPort
move.l 86(a0),a1 ;wn->UserPort
move.b 15(a1),d1 ;MsgPort->SigBit
ext.w d1
move.w d1,intuisig
tst.b iconifyon
beq.s 1$
tst.b ownscreen
bne.s 1$
lea iconifgad,a1
moveq #0,d0
CALL AddGadget,intuibase(PC)
move.l wnptr(PC),a0
CALL RefreshWindowFrame,intuibase(PC)
1$ lea tattr(PC),a0
CALL OpenFont,gfxbase(PC)
tst.l d0
beq.s 2$
move.l d0,a0
move.l rastport(PC),a1
CALL SetFont,gfxbase(PC)
2$ bsr getwindowsize
bsr getcurpos
bsr putiline
bsr UpdateIArea
bsr starttimer
bsr showwhat
rts
usescreen tst.b fromfile
bne.s 1$
tst.b ownscreen
bne.s 1$
bsr createscreen
1$ move.b #1,ownscreen
rts
usewindow tst.b fromfile
beq.s 1$
clr.b ownscreen
rts
1$ tst.b ownscreen
beq.s 2$
move.l wnptr(PC),d0
beq.s 3$
move.l d0,a0
CALL CloseWindow,intuibase(PC)
clr.l wnptr
clr.l intuimsg
3$ move.l screenptr(PC),d0
beq.s 4$
move.l d0,a0
CALL CloseScreen,intuibase(PC)
clr.l screenptr
clr.b ownscreen
4$ bra setupwindow
2$ rts
dchange lea dchead(PC),a0
bsr puthead
lea tdd(PC),a1
move.l _SysBase(PC),a0
lea 350(a0),a0
CALL FindName,_SysBase(PC)
tst.l d0
beq R_T_S
move.l d0,a2
lea 32(a2),a2
moveq #0,d5
2$ lea 4(a2),a2
move.l 0(a2),d0
beq 3$
move.l d0,a0
lea $18e(a0),a0
CALL Disable,_SysBase(PC)
5$ tst.l 0(a0)
beq.s 6$
move.l 0(a0),a0
bra.s 5$
6$ lea -4(a0),a5
lea buffer+100,a3
9$ move.l 0(a5),a5
tst.l 0(a5)
beq.s 11$
move.l a5,(a3)+
bne.s 9$
11$ clr.l (a3)+
CALL Enable,_SysBase(PC)
lea buffer+100,a3
7$ move.l (a3)+,d0
beq.s 3$
move.l d0,a5
cmp.w #20,28(a5)
bne.s 7$
move.l 40(a5),a4
move.l a4,d0
move.l d0,node
bsr hexan
move.l a4,d0
beq.s 10$
move.l 14(a4),d0
bsr hexan
move.l 18(a4),d0
bsr hexan
10$ move.l d5,d3
or.b #48,d3
move.b d3,tddrives+2
move.l #tddrives,d0
bsr putstr
move.l 14(a5),d0
beq.s 8$
move.l d0,a0
move.l 16(a0),d0
8$ bsr getaskname2
bsr newline
bra.s 7$
3$ addq #1,d5
cmp.w #4,d5
bmi 2$
R_T_S rts
DATASTART EQU *
dosbase dc.l 0
intuibase dc.l 0
gfxbase dc.l 0
condev dc.l 0
parmtxt dc.l 0
infile dc.l 0
ptr dc.l 0
oldidl dc.l 0
olddisp dc.l 0
mysignal dc.l 0
auxsig dc.l 0
trapsignal dc.l 0
iostatus dc.l -1
devstatus dc.l -1
tasksigs dc.l 0
cancelbit dc.l 0
cancelbnum dc.l 0
_SysBase dc.l 0
InputMsg dc.l 0
InRequest dc.l 0
startmess dc.l 0
savedat dc.l 0
wnptr dc.l 0
aliaslist dc.l 0
screenptr dc.l 0
intuimsg dc.l 0
mytask dc.l 0
wbmsg dc.l 0
pointer dc.l 0
replyport dc.l 0
timerport dc.l 0
finfoptr dc.l 0
myseg dc.l 0
dispatches dc.l 0
maxdisp dc.l 0
deltadisp dc.l 0
wbaddr dc.l 0
node dc.l 0
remembr dc.l 0
remembr2 dc.l 0
captask dc.l 0
snoopport dc.l 0
tasksnum dc.l 0
blanks dc.l 0
hidestart dc.l 0
dispnum dc.l 0
iocount dc.l 0
dummyinput dc.l 0
rastport dc.l 0
outchain dc.l 0
firstline dc.l 0
oldfirstline dc.l 0
timeoutm dc.l 0
numlines dc.l 0
oldnumlines dc.l 0
gothline dc.l 0
lastprinted dc.l 0
oldlastprinted dc.l 0
oldpageend dc.l 0
maxlines dc.l 500
realstack dc.l 0
wnnormflgs dc.l $646
dc.l $1104f
wnscrflags dc.l $600
dc.l $31948
fkeys dc.l *+4
dc.l 0
dc.l fkeys
history dc.l *+4
dc.l 0
dc.l history
curhist dc.l 0
secs dc.l 0
mics dc.l 0
time10 dc.l 0
tattr dc.l fontname
dc.w 8
dc.w 0
stplist dc.l lh_tail
lh_tail dc.l 0
dc.l stplist
dc.b 1
dc.b 0
InInterrupt dc.l 0 ;ln_Succ
dc.l 0 ;ln_Pred
dc.b 2 ;ln_Type
dc.b 60 ;ln_Pri
dc.l xopsleep ;ln_Name
dc.l 0 ;is_Data
dc.l Keyhandler ;is_Code()
IOCounter dc.l 0 ;ln_Succ
dc.l 0 ;ln_Pred
dc.b 2 ;ln_Type
dc.b -1 ;ln_Pri
dc.l IOcntname ;ln_Name
dc.l 0 ;is_Data
dc.l countio ;is_Code()
newwindow dc.w 0,0
dc.w 500,100
dc.b 0,1
nwflgs dc.l $646
dc.l $1104f
wn_firstgad dc.l 0
dc.l 0
dc.l windowname
nwscreen dc.l 0
dc.l 0
dc.w 110,50
dc.w 808,-1
nwtype dc.w 1
newscreen dc.w 0,0
nssize dc.w 0,0
dc.w 1
dc.b 0
dc.b 1
nsviewmode dc.w 0
dc.w $1f
dc.l 0
dc.l windowname
dc.l 0,0
excpterror dc.l 0
excpttask dc.l 0
excptaddr dc.l 0
excptpc dc.l 0
window_l dc.w 0
window_t dc.w 0
window_w dc.w 550
window_h dc.w 200
colms dc.w 0
timersig dc.w 0
intuisig dc.w 0
ibufferlen dc.w 0
cposy dc.w 0
curpos dc.w 0
bottomin dc.w 1
ipos dc.w 0
hnum dc.w 0
minnumchars dc.w 2
maxhlines dc.w 10
qualifier dc.w 0
rows dc.w 0
maxllength dc.w 0
loffset dc.w 0
repeat dc.w 0
repeatlen dc.w 0
edline dc.w 999
cmdptr dc.w 0
getanswer dc.w 0
currenty dc.w 0
cmdcompnr dc.w 0
cmdcomplen dc.w -1
cmdcompflag dc.w 0
binarea dc.b ' ',0
EVEN
minus dc.b ' '
decimal dc.b ' ',0
entries dc.b 0
timeout dc.b 5
procnum dc.b 0
timerstate dc.b 0
running dc.b 0
newpri dc.b 0
tasktyp dc.b 0
background dc.b 0
bool dc.b 0
printed dc.b 0
cbreak dc.b 0
usageflag dc.b 0
mnflag dc.b 1
tports dc.b 1
headon dc.b 1
hideon dc.b 1
sorton dc.b 1
wanttraps dc.b 0
addlines dc.b 0
eof dc.b 0
fromfile dc.b 0
iconifyon dc.b 1
gotguru dc.b 0
ownscreen dc.b 0
insmode dc.b 0
cmdcli dc.b 1
params dc.b 'tfdlrempisc'
parmnum equ *-params
dc.b 0
t2header dc.b ' ID STATE SIGALLOC SIGWAIT SIGRECVD PC TASKNAME',0
theader dc.b ' ID TYPE STATE PRI CPUSE NUM TASKNAME',0
lheader dc.b ' NODE CNT VER REV FLAGS ',0
libnam dc.b 'LIBRARY NAME',0
devnam dc.b 'DEVICE NAME',0
resnam dc.b 'RESOURCE NAME',0
mheader dc.b ' LOWER UPPER FREE ATTR PRI HUNK NAME',0
cr dc.b 10,0
iheader dc.b ' NODE DATA CODE PRI T S TYPE INTERRUPT NAME',0
inheader dc.b ' NODE DATA CODE PRI NAME',0
rheader dc.b ' ADDR PRI FLAGS VER TYPE RESIDENT NAME',0
pheader dc.b ' NODE PORTNAME FLAGS SIGBT NUM SIGTASK',0
hunkheader dc.b ' NUM BCPL DATA LENGTH',0
ddheader dc.b 'DEVICE HDS SECTORS TRACKS BUFFERS STATE HANDLER',0
cdheader dc.b 'PROCESSNAME CURRENT DIRECTORY',0
ofheader dc.b ' LOCK ACCESS SIZE PATH/FILENAME',0
scrheader dc.b 'NUM ADDR TITLE',0
wnheader dc.b ' ADDR OWNERTASK TITLE',0
fohead dc.b ' NODE CNT Y X TYPE LO HI NAME',0
kickhead dc.b 'START END LENGTH',0
snoophead dc.b 'ACTION REQUIREMENTS LENGTH FROM TO CALLER',0
stackhead dc.b 'SPLower SIZE USED TASKNAME',0
clicomhead dc.b ' ID STATE TYPE MODE NUM PROCESSNAME COMMAND',0
tiohead dc.b 'IORQUEST UNIT SECS REQUESTING TASK',0
dchead dc.b ' NODE DATA CODE UNIT TASK',0
alhead dc.b 'ALIAS NAME COMMAND',0
tdd dc.b 'trackdisk.device',0
tddrives dc.b 'DF : ',0
timerunits dc.b 'MicroHz ',0
dc.b 'VBlank ',0
access dc.b ' Read ',0
dc.b ' Write ',0
romfnt dc.b 'Rom ',0
diskfnt dc.b 'Disk ',0
wbname dc.b 'Workbench',0
status dc.b 'Added ',0
dc.b 'Running ',0
dc.b 'Ready ',0
dc.b 'Waiting ',0
dc.b 'Exeption ',0
dc.b 'Removed ',0
dc.b 'Frozen ',0
dc.b 'Frozen ',0
type dc.b 'Unknown ',0
tasktype dc.b 'Task ',0
dc.b 'Interrupt ',0
dc.b 'Device ',0
dc.b 'Msgport ',0
dc.b 'Message ',0
dc.b 'Freemsg ',0
dc.b 'Replymsg ',0
dc.b 'Resource ',0
dc.b 'Library ',0
dc.b 'Memory ',0
softinttype dc.b 'Softint ',0
dc.b 'Font ',0
proctype dc.b 'Process ',0
dc.b 'Semaphore ',0
mp_flags dc.b 'Signal ',0
dc.b 'Softint ',0
dc.b 'Ignore ',0
windowname dc.b 'Xoper V2.2 (c) 1989 Werner G',$fc,'nther',0
newname dc.b 'Xoper',0
memportname dc.b 'MemSnoop',0
xopcon dc.b 'XopPackets',0
xopsleep dc.b 'Xop-A-A-x',0
IOcntname dc.b 'Xop-I/O-counter',0
cmdnum set 0
commds ADDCMD 'time'
ADDCMD 'taskpri'
ADDCMD 'info'
ADDCMD 'pri'
ADDCMD 'flush'
ADDCMD 'freeze'
ADDCMD 'warm'
ADDCMD 'signal'
ADDCMD 'break'
ADDCMD 'alert'
ADDCMD 'lastalert'
ADDCMD 'hold'
ADDCMD 'exit'
ADDCMD 'clear'
ADDCMD 'cancel'
ADDCMD 'taskports'
ADDCMD 'hunks'
ADDCMD 'devices'
ADDCMD 'openlib'
ADDCMD 'closelib'
ADDCMD 'currentdir'
ADDCMD 'cd'
ADDCMD 'mypri'
ADDCMD 'files'
ADDCMD 'locks'
ADDCMD 'unlock'
ADDCMD 'screens'
ADDCMD 'windows'
ADDCMD 'closescreen'
ADDCMD 'closewindow'
ADDCMD 'fonts'
ADDCMD 'windowfonts'
ADDCMD 'lockdrive'
ADDCMD 'freedrive'
ADDCMD 'capture'
ADDCMD 'clrcold'
ADDCMD 'clrcool'
ADDCMD 'clrwarm'
ADDCMD 'snoop'
ADDCMD 'usage'
ADDCMD 'inputhandler'
ADDCMD 'header'
ADDCMD 'sort'
ADDCMD 'hide'
ADDCMD 'hidden'
ADDCMD 'window'
ADDCMD 'kill'
ADDCMD 'iconifyoff'
ADDCMD 'historylines'
ADDCMD 'minimumchars'
ADDCMD 'showhistory'
ADDCMD 'repeat'
ADDCMD 'remresident'
ADDCMD 'saveoutput'
ADDCMD 'killhistory'
ADDCMD 'backdropicon'
ADDCMD 'setfont'
ADDCMD 'trapguru'
ADDCMD 'outputlines'
ADDCMD 'usescreen'
ADDCMD 'usewindow'
ADDCMD 'timerio'
ADDCMD 'diskchange'
ADDCMD 'alias'
ADDCMD 'remnode'
ADDCMD 'setfkey'
ADDCMD 'clicmd'
hexarea dc.b ' ',0
hextab dc.b '0123456789abcdef'
infoh2 dc.b 'Dispat/Sec:',0
infoh1 dc.b 'CPU:',0
infoh3 dc.b 'CPU activity: ',0
infoh6 dc.b 'Total:',0
infoh4 dc.b '% ',0
infoh7 dc.b 'I/O Ints/Sec: ',0
cpu0 dc.b '68000',0
cpu1 dc.b '68010',0
cpu2 dc.b '68020',0
cpu3 dc.b '/68881',0
devload dc.b 'loaded ',0
devnload dc.b 'unloaded ',0
inten dc.b 'E ',0
intdis dc.b 'D ',0
intserv dc.b 'S ',0
inthand dc.b 'H ',0
notfile dc.b '--- ------- ------- ------- ',0
longnix dc.b '-'
smallnix dc.b '----'
nix dc.b '--- ',0
noinfo dc.b 'No Info on'
oneblank dc.b ' ',0
equal dc.b '= ',0
openbrak dc.b '[ ',0
closebrak dc.b ' ]',0
namerr dc.b 'Unable to find ',0
fonterr dc.b "Can't open ",0
adrerr dc.b 'Address Error!',0
aliaserr dc.b 'Single character alias names using "',0
aliaserr2 dc.b '"',10,'are not allowed.',0
noworkbench dc.b "Workbench isn't active !",0
openerr dc.b 'Could not open file ',0
noderr dc.b "Can't find this Node. Continue anyway ? (Y/N)",0
listerr dc.b 'Unable to find ListHeader. Sort aborted.',0
wiwerr dc.b 'Script file only',0
gurutxt dc.b 'Guru Meditation #',0
clrtxt dc.b 'Memory Hunks cleared.',0
canerr0 dc.b 'Process is not a CLI-task',10
dc.b 'Has it been started from Workbench ? (Y/N)',10,0
canerr1 dc.b 'Process was created by CreateProc()',10
dc.b 'Shall I UnLoad() ? (Y/N)',10,0
unloaderr dc.b "Arrrgh.. can't find segments, aborting",0
noprocs dc.b 'Not a Process.',0
notload dc.b 'No program loaded.',0
cliprocs dc.b 'Cli-Process',0
procloaded dc.b 'Loaded as a command: ',0
segloaded dc.b 'Created by CreateProc()',0
coldtxt dc.b 'Cold Capture: ',0
cooltxt dc.b 'Cool Capture: ',0
warmtxt dc.b 'Warm Capture: ',0
kicktxt dc.b 'KickMem : ',0
unset dc.b 'unset',0
intnames dc.b 'Serial Out ',0
dc.b 'Disk Block ',0
dc.b 'SoftInt ',0
dc.b 'Ports ',0
dc.b 'Coper ',0
dc.b 'Vert.Blank ',0
dc.b 'Blitter ',0
dc.b 'Audio Ch.0 ',0
dc.b 'Audio Ch.1 ',0
dc.b 'Audio Ch.2 ',0
dc.b 'Audio Ch.3 ',0
dc.b 'Serial In ',0
dc.b 'Disk Sync ',0
dc.b 'External ',0
dc.b 'SoftInt ',0
dc.b 'NMI ',0
inttyp dc.b 0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1
fontname dc.b 'topaz.font',0
devicenam dc.b 'input.device',0
timernam dc.b 'timer.device',0
memlarg dc.b 'LARGEST ',0
memclr dc.b 'CLEAR ',0
memfast dc.b 'FAST ',0
memchip dc.b 'CHIP ',0
mempubl dc.b 'PUBLIC ',0
failed dc.b 'Failed !',0
allok dc.b 'ALLOC: ',0
free dc.b 'FREE: ',0
backg dc.b 'Bckg ',0
foreg dc.b 'Frgr ',0
script dc.b 'Batch ',0
interact dc.b 'Intct ',0
startupname dc.b 'S:Xoper.Startup',0
nameerr dc.b 'Name or address is missing.',10
synerr dc.b 'Syntax Error, type "?" for help',10,0
wberr dc.b "Can't examine Workbench locks",0
dnotf dc.b 'Directory not found',0
notdir dc.b 'Not a directory',0
nomount dc.b ' not mounted.',0
dishelp dc.b 10,'Names are case sensitive and followed by a ":"',0
unlerr dc.b 'Lock not found',0
unl1 dc.b 'Lock is on ',0
unltxt dc.b 'Old lock was: ',0
unltxt2 dc.b 'Unlock ? (Y/N)',10,0
scnofound dc.b 'Screen not found.',0
winnofound dc.b 'Window not found.',0
stperr dc.b 'Task must be "READY" or "WAITING"',10,0
waerr dc.b 'Task must be "FROZEN"',10,0
whatsthis dc.b '???.?',0
toomuch dc.b '??? ',0
timenotset dc.b ' disabled.',0
whattime dc.b 'Refresh time in secs:',0
stoped dc.b '<Break>',0
onscr dc.b 'On Screen: ',0
whatnow dc.b 'Kill, ignore (K/I)?',0
noguru dc.b 'None found.',0
softfail dc.b 'Software failure!',10,'Task: ',0
addrserr dc.b 'Bad aligned address was: ',0
procount dc.b 'PC: ',0
diskfont dc.b 'diskfont.library',0
usetxt dc.b 'USAGE: Xoper [T] [F] [L] [D] [R] [E] [M] [P] [I] [S] [C]',10
dc.b 'OR Xoper -b',10
dc.b 'DISPLAY:',10
dc.b '[T]asks [F]=taskflags [L]ibraries [D]evices [R]esources',10
dc.b 'r[E]sident [M]emory [P]orts [I]nterrupts [S]tack',10
dc.b '[C]litasks [Q]uit',10,10
dc.b 'OTHER SYSTEM LISTS:',10
dc.b 'Windows Screens Fonts WindowFonts CurrentDir',10
dc.b 'Files Locks Devices InputHandler Capture',10
dc.b 'TimerIO DiskChange',10,10
dc.b 'COMMANDS:',10
dc.b 'Time <secs>',10
dc.b 'Taskpri <priority> [processnum] <taskname>',10
dc.b 'Mypri <priority>',10
dc.b 'Signal <mask(hex)> [processnum] <taskname>',10
dc.b 'Break [processnum] <taskname>',10
dc.b 'Freeze|Warm [processnum] <taskname>',10
dc.b 'Kill [processnum] <taskname>',10
dc.b 'Snoop [processnum] <taskname>',10
dc.b 'Hide <taskname>',10
dc.b 'Pri <priority> <nodename>',10
dc.b 'Info <name>',10
dc.b 'RemResident <resident module name>',10
dc.b 'Clear <longword(hex)>',10
dc.b 'Hunks [processnum] <procname>',10
dc.b 'CD <directory> [processnum] <procname>',10
dc.b 'UnLock <lock>',10
dc.b 'OpenLib | Closelib <libraryname>',10
dc.b 'CloseWindow| Closescreen <title>',10
dc.b 'SetFont [size] <fontname> <windowtitle>',10
dc.b 'LockDrive | Freedrive <drivename:>',10
dc.b 'Window <leftedge topedge width height> (scriptfile only) ',10
dc.b 'OutputLines <maximum # of lines>',10
dc.b 'HistoryLines <maximum # of lines>',10
dc.b 'MinimumChars <minimum # of characters>',10
dc.b 'SaveOutput <filename>',10
dc.b 'Repeat <Command line>',10
dc.b 'SetFKey <number> <string>',10
dc.b 'Alias [<aliasname> <commandname>]',10,10
dc.b 'COMMANDS WITHOUT PARAMETERS:',10
dc.b 'Flush LastAlert ClrCool ClrCold ClrWarm',10
dc.b 'TrapGuru',10,10
dc.b 'OPTIONS:',10
dc.b 'Sort TaskPorts Hidden Usage Header',10
dc.b 'IconifyOff BackDropIcon ShowHistory KillHistory UseScreen',10
dc.b 'UseWindow CLICmd',10
dc.b 'Hold Exit'
null dc.b 0
IFD DEBUG
dosname dc.b 'dos.library',0
intuiname dc.b 'intuition.library',0
gfxname dc.b 'graphics.library',0
conname dc.b 'console.device',0
EVEN
ENDC
BSS blabla
buffer ds.b 2200
out ds.b 100
dummy ds.b 80
in ds.b 80
cputime ds.b 1000
ievent ds.b 32
outevent ds.b 20
inputbuffer ds.b 88
repeatbuffer ds.b 81
mypacket BSS standardpacket
LN_SUCC ds.l 1
LN_PRED ds.l 1
LN_TYPE ds.b 1
LN_PRI ds.b 1
LN_NAME ds.l 1
MP_FLAGS ds.b 1
MP_SIGBIT ds.b 1
MP_SIGTASK ds.l 1
MN_SIZE ds.w 1
LH_HEAD ds.l 1
LH_TAIL ds.l 1
LH_TAILPRED ds.l 1
LH_TYPE ds.b 1
LH_pad ds.b 1
dp_Link ds.l 1
dp_Port ds.l 1
dp_Type ds.l 1
dp_Res1 ds.l 1
dp_Res2 ds.l 1
dp_Arg1 ds.l 1
dp_Arg2 ds.l 1
dp_Arg3 ds.l 1
dp_Arg4 ds.l 1
dp_Arg5 ds.l 1
dp_Arg6 ds.l 1
dp_Arg7 ds.l 1
timerio ds.b 40
CODE ICONIFY,CHIP
iconify lea icnwindow,a0
CALL OpenWindow,intuibase
move.l d0,iconwindow
waitforcall move.l iconwindow,a0
move.l $56(a0),a0 ;wn->UserPort
moveq #0,d1
move d1,d0
move.b 15(a0),d1 ;UserPort->SigBit
bset d1,d0
move.l d0,d6
or.l mysignal,d0
or.l trapsignal,d0
CALL Wait,_SysBase
and.l d0,d6
bne.s fromwindow
move.l mysignal,d1
and.l d0,d1
bne icondone
and.l trapsignal,d0
beq.s waitforcall
move.b #1,gotguru
bra.s icondone
fromwindow move.l iconwindow,a0
move.l $56(a0),a0 ;wn->UserPort
CALL GetMsg,_SysBase
tst.l d0
beq.s waitforcall
move.l d0,a1
CALL ReplyMsg,_SysBase
move.l iconwindow(PC),a0
move.l 4(a0),d5
cmp.l icnwindow(PC),d5
bne.s 1$
lea nsecs(PC),a0
lea nmics(PC),a1
CALL CurrentTime,intuibase
movem.l osecs,d0-d3
CALL DoubleClick,intuibase
tst.l d0
bne.s icondone
move.l nsecs(PC),osecs
move.l nmics(PC),omics
1$ move.l d5,icnwindow
bra waitforcall
icondone move.l iconwindow,a0
move.l 4(a0),icnwindow ;LeftEdge+TopEdge
CALL CloseWindow,intuibase
rts
osecs dc.l 0
omics dc.l 0
nsecs dc.l 0
nmics dc.l 0
iconwindow dc.l 0
icnwindow dc.w 40,170,72,28
dc.b 0,1
dc.l $20,$800
dc.l gadget,0,0,0,0
dc.w 72,28,72,28
dc.w 1
gadget dc.l 0
dc.w 0,0,72,28,4,2,$20
dc.l image
dc.l 0,0,0,0
dc.w 0
dc.l 0
image dc.w 0,0,72,28,2
dc.l imagedata
dc.b 3,0
dc.l 0
imagedata dc.w $000F,$FFFF,$FFFF,$FFF8,$0000,$001F,$FFFF,$FFFF
dc.w $FFFC,$0000,$001F,$0000,$0000,$007C,$0000,$001F
dc.w $7FFF,$FFFF,$FF7C,$0000,$001F,$4A46,$0244,$557C
dc.w $0000,$001F,$5108,$D411,$817C,$0000,$001F,$7FFF
dc.w $FFFF,$FF7C,$0000,$001F,$0000,$0000,$007C,$0000
dc.w $001F,$30C0,$0000,$007C,$0000,$001F,$1980,$0000
dc.w $007C,$0000,$001F,$0F0F,$1F0F,$1F7C,$0000,$001F
dc.w $0619,$9999,$997C,$0000,$001F,$0F19,$999F,$987C
dc.w $0000,$001F,$1999,$9F18,$187C,$0000,$001F,$30CF
dc.w $180F,$187C,$0000,$001F,$0000,$1800,$007C,$0000
dc.w $001F,$0000,$0000,$007C,$0000,$001F,$FFFF,$FFFF
dc.w $FFFC,$0000,$000F,$FFFF,$FFFF,$FF18,$0000,$0000
dc.w $0000,$0000,$0000,$0000,$3FFF,$FFFF,$FFFF,$FFFF
dc.w $FC00,$FDFF,$FFFF,$FFFF,$FFFF,$FF00,$EBFF,$FFFF
dc.w $FFFF,$FFFF,$FF00,$F7FF,$FFFF,$FFFF,$F800,$0700
dc.w $FFFF,$FFFF,$FFFF,$FFFF,$FF00,$FFFF,$FFFF,$FFFF
dc.w $FFFF,$FF00,$FFFF,$FFFF,$FFFF,$FFFF,$FF00,$3FFF
dc.w $FFFF,$FFFF,$FFFF,$FC00,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$FFFF
dc.w $FFFF,$FF80,$0000,$0000,$FFFF,$FFFF,$FF80,$0000
dc.w $0000,$FFFF,$FFFF,$FF80,$0000,$0000,$FFFF,$FFFF
dc.w $FF80,$0000,$0000,$FFFF,$FFFF,$FF80,$0000,$0000
dc.w $FFFF,$FFFF,$FF80,$0000,$0000,$8000,$0000,$0080
dc.w $0000,$0000,$8000,$0000,$0080,$0000,$0000,$8000
dc.w $0000,$0080,$0000,$0000,$8000,$0000,$0080,$0000
dc.w $0000,$8000,$0000,$0080,$0000,$0000,$8000,$0000
dc.w $0080,$0000,$0000,$8000,$0000,$0080,$0000,$0000
dc.w $8000,$0000,$0080,$0000,$0000,$FFFF,$FFFF,$FF80
dc.w $0000,$0000,$0000,$0000,$00E0,$0000,$0000,$0000
dc.w $0000,$00E0,$0000,$0000,$1FFF,$FFFF,$F800,$0000
dc.w $0000,$0080,$0040,$0000,$0000,$0200,$0080,$0040
dc.w $0000,$0000,$1400,$0080,$0040,$003F,$0000,$0800
dc.w $0080,$0040,$07FF,$F800,$0000,$0080,$0040,$003F
dc.w $0000,$0000,$0080,$0040,$0000,$3800,$FFFF,$FFFF
dc.w $FFFF,$FFFF,$FE00,$0000,$0080,$0040,$0000,$0000
iconifgad dc.l 0
dc.w -83,0
dc.w 31,10
dc.w $14
dc.w $41
dc.w 1
dc.l iconifimg
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.w 0
dc.l 0
iconifimg dc.w 0,0
dc.w 31,10
dc.w 2
dc.l iconifdata
dc.b $0003,$0000
dc.l 0
iconifdata dc.w $7FFF,$FFFC,$601F,$FFFC,$6000,$000C,$607F,$FFCC
dc.w $6060,$00CC,$6067,$FCCC,$7E60,$00CC,$7E7F,$FFCC
dc.w $7E00,$000C,$7FFF,$FFFC,$0000,$0000,$1FE0,$0000
dc.w $1FFF,$FFF0,$1F80,$0030,$1F9F,$FF30,$1F98,$0330
dc.w $019F,$FF30,$0180,$0030,$01FF,$FFF0,$0000,$0000
END